package service.Impl;

import dao.SysUserMapper;

import org.springframework.context.annotation.Scope;
import entity.SysUser;

import org.springframework.stereotype.Service;
import service.SysUserService;

import java.util.List;
@Scope("prototype")
@Service
public class SysUserServiceImpl implements SysUserService{
    private SysUserMapper sysUserMapper;
    @Override
    public List<SysUser> getList(SysUser sysUser) {
        try {
            return sysUserMapper.selectSysUserList(sysUser);
        }catch (RuntimeException e){
            e.printStackTrace();
            throw e;
        }
    }

    @Override
    public boolean add(SysUser sysUser) {
        boolean result = false;
        try {
            if (sysUserMapper.add(sysUser)){
                result = true;
            }
        }catch (RuntimeException e){
            e.printStackTrace();
            throw e;
        }
        return result;
    }

    public SysUserMapper getSysUserMapper(){
        return sysUserMapper;
    }
    public SysUserServiceImpl(SysUserMapper sysUserMapper) {
        this.sysUserMapper = sysUserMapper;
    }

}
